#include <iostream>
#include <vector>
#include <unistd.h>
#include "Thread.hpp"

void Print()
{
    while (true)
    {
        printf("haha, 我是一个封装的线程...\n");
        sleep(1);
    }
}

int main()
{
    std::vector<Thread> threads;

    for (int i = 0; i < 10; i++)
    {
        threads.push_back(Thread(Print));
    }

    for (auto &t : threads)
    {
        t.Run();
    }
    

    // std::cout << "是否启动成功: " << t.IsRuning() << std::endl;
    // std::cout << "启动时间戳: " << t.start_timestamp() << std::endl;
    // std::cout << "线程的名字" << t.name() << std::endl;

    for (auto &t : threads)
    {
        t.Join();
    }
   
    return 0;
}